/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Database;

import jWASA.Sensor;
import java.io.Serializable;
import java.sql.Date;
import java.sql.Time;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.ManyToOne;

/**
 *
 * @author gianmariospacagna
 */
@Entity
public class EntitySample implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    private Long id;
    
    @ManyToOne
    private EntitySensor sensor;
    //private Double[] values;
    
    private Double val;

    public Long getTimestamp() {
        return id;
    }

    public void setTimestamp(Long ts) {
        this.id = ts;
    }

    public EntitySensor getSensor() {
        return sensor;
    }

    public void setSensor(EntitySensor sensor) {
        this.sensor = sensor;
    }

    /*public Double[] getValues() {
        return values;
    }

    public void setValues(Double[] values) {
        this.values = values;
    }*/
    public Double getVal(){
        return val;
    }
    public void setVal(double val){
        this.val=val;
    }
    
    
    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof EntitySample)) {
            return false;
        }
        EntitySample other = (EntitySample) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "Database.EntitySample[ id=" + id + " ]";
    }

    
    
}
